package com.smartfactory.sail.utils;

import com.smartfactory.sail.entity.enums.StorageStatusEnum;

/**
 * @author 王巨壁
 * @title: CommonUtils
 * @projectName smart-sail
 * @description: 一些无处安放的通用方法
 * @date 2019/8/2517:41
 */
public class CommonUtils {

    public static StorageStatusEnum getStorageStatus(Integer size, Integer upperLimit, Integer lowLimit) {
        int avg = (upperLimit + lowLimit) / 2;
        if (size > avg) {
            return StorageStatusEnum.CZ;
        } else if (size <= avg && size > lowLimit) {
            return StorageStatusEnum.ZC;
        } else {
            return  StorageStatusEnum.BZ;
        }
    }
}
